Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Objects /
Chapter 2 - Shape Objects / Using Shape Objects


Converting Shapes From One Type to Another

QuickDraw GX allows you to change the types of the shape objects you have created. You use the GXGetShapeType function, described on page 2-66 of this chapter, to determine the type of a shape. To convert a shape to a new type, you use the GXSetShapeType function, described on page 2-66 of this chapter.

The rules for conversion among shape geometries are specific to each shape type and thus are not described here. See the appropriate chapters of Inside Macintosh: QuickDraw GX Graphics and Inside Macintosh: QuickDraw GX Typography for this information. Table 2-5 describes where to look in each book for information regarding each possible kind of conversion.
Table 2-5 Where to find information on shape-type conversion
 

 

To a
geometric shape
To a
bitmap shape
To a
picture shape
To a
typographic shape
From a geometric shapeSee "Geometric Shapes" in QuickDraw GX GraphicsSee "Bitmap Shapes" in QuickDraw GX GraphicsSee "Picture Shapes" in QuickDraw GX Graphics
(not possible)
From a bitmap shapeSee "Geometric Shapes" in QuickDraw GX Graphics
(no change)
See "Picture Shapes" in QuickDraw GX Graphics
(not possible)
From a picture shapeSee "Geometric Shapes" in QuickDraw GX GraphicsSee "Bitmap Shapes" in QuickDraw GX Graphics
(no change)

(not possible)
From a typographic shapeSee "Typographic Shapes" in QuickDraw GX TypographySee "Bitmap Shapes" in QuickDraw GX GraphicsSee "Picture Shapes" in QuickDraw GX GraphicsSee "Typographic Shapes" in QuickDraw GX Typography

Another common kind of shape conversion is not from one shape type to another, but from standard object form into primitive form. Some functions, such as GXSetShapeClip, described in the chapter "Transform Objects" in this book, require
a primitive shape to hold the clip shape. A primitive shape is a shape whose stylistic information has been incorporated into the shape's geometry. For example, a horizontal line with a thick pen style becomes a rectangle when converted to a primitive shape. To make a shape into a clip, you first convert it to its primitive form with the function GXPrimitiveShape. For more information about primitive shapes in general, see
the geometric operations chapter of Inside Macintosh: QuickDraw GX Graphics. For information on primitive shapes for typographic shapes, and the difference between using GXPrimitiveShape and GXSetShapeType to obtain a primitive shape, see the typographic shapes chapter of Inside Macintosh: QuickDraw GX Typography.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help